// In App.js in a new project

import * as React from 'react';
import { View, Text } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
// import Login from './src/pages/login';
import Index from '../src/pages/index/index';


const Stack = createNativeStackNavigator();

function App(): React.JSX.Element {
  return (
    // <NavigationContainer>
    //   <Stack.Navigator>
    //     <Stack.Screen name="Home" component={Home} />
    //   </Stack.Navigator>
    // </NavigationContainer>


    // 路由页面配置
    <NavigationContainer>
        <Stack.Navigator
            initialRouteName="Index"
            screenOptions={{
                headerShadowVisible: false, // android 导航去阴影
                headerTitleAlign: 'center', // 标题居中
                // 设置导航栏字体样式
                headerTitleStyle: {
                    fontSize: 17,
                    color: '#333333',
                    fontFamily: 'PingFangSC-Semibold',
                    fontWeight: '700',
                }
            }}
        >
            {/* <Stack.Screen
                name="Login"
                component={Login}
                options={{
                    headerShown: false
                }} /> */}
            <Stack.Screen
                name="Index"
                component={Index}
                options={{
                // headerShown: false, // 是否显示头部
                headerBackVisible: true  // 是否开启返回按钮
            }} />
            {/* <Stack.Screen
                name="Home"
                component={Home}
                options={{ title: '首页' }}
            />
            <Stack.Screen
                name="Detail"
                component={Detail}
                options={{ title: '详情' }}
            /> */}
            {/* <Stack.Screen
                name={Views.Redeem}
                component={Redeem}
                options={{ title: '积分兑换' }}
            />
            <Stack.Screen
                name={Views.Rule}
                component={Rule}
                options={{ title: '积分兑换规则' }}
            /> */}
        </Stack.Navigator>
    </NavigationContainer>
  );
}

export default App;